﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using Microsoft.Win32;
using System.Windows.Forms;

namespace shudiangis.Common
{
    class CheckUserEnvironment
    {
        public static bool CheckArcgisRuntime()
        {
            RegistryKey LocalMachineRegKey = Registry.LocalMachine;
            RegistryKey InstallDirRegKey = LocalMachineRegKey.OpenSubKey(@"SOFTWARE\ESRI\CoreRuntime");

            if (InstallDirRegKey == null)
            {
                MessageBox.Show("没有安装ArcGIS Runtime！请先安装。");
                return false;
            }
            else
            {
                string InstallDirStr = InstallDirRegKey.GetValue("InstallDir").ToString();
                //MessageBox.Show("ArcGIS Runtime安装在了如下目录：" + InstallDirStr);
                return true;
            }

        }
    }
}
